Skip to content

feat: additional MIME type mappings#2

Merged
ghsnd merged 5 commits intoFnOio:developmentfrom
redmer:patch-1
Mar 17, 2026
Merged

feat: additional MIME type mappings#2
ghsnd merged 5 commits intoFnOio:developmentfrom
redmer:patch-1

Conversation

@redmer
Copy link
Contributor

@redmer redmer commented Mar 16, 2026

This PR adds a bunch of mimetypes from the Python stdlib list of mimetypes so more mimetypes would be recognized.

I'm using RMLMapper to map from our digital asset management system to RDF. It contains loads of PDF's, images, office documents and so on. I'm using idlabfn:getMIMEType to map it, but that recognizes only a small list of mimetypes. IDLabFunctions.java#L205-L225

# sample from sourcemapping.rml.yaml
      # Mimetype
      - predicate: sdo:encodingFormat
        object:
          type: literal
          function: idlabfn:getMIMEType
          parameters:
            - parameter: idlabfn:str
              value: "$(filename)"

Notes:

  • I'm not versed enough in Java to know if there's a way to make this list a once-generated static member.
  • Though quite trivial, I thought I should mention the CPython license here.

@ghsnd ghsnd merged commit 412e2f2 into FnOio:development Mar 17, 2026
@ghsnd
Copy link
Contributor

ghsnd commented Mar 17, 2026

Thanks!
I also refactored it a bit to be statically initialized so it only loads once.
Best regards, Gerald

@redmer redmer deleted the patch-1 branch March 17, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants